package com.yc.Testjvm;

import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLClassLoader;

import org.apache.commons.lang3.reflect.FieldUtils;

public class TestClassLoader1 {

	public static void main(String[] args) {
	    try {
	        URLClassLoader ucl = new URLClassLoader(new URL[]{new URL("file:///F:/ws-test/")});
	        Class<?> cls = ucl.loadClass("com.test.jdk.Key");
	        Field field = FieldUtils.getField(cls, "key", true);
	        Object value = field.get(cls.newInstance());
	        System.out.println(value);
	    } catch (Exception e) {
	        e.printStackTrace();
	    }
	}
}
